@echo off

if %0%==_xy goto disk_1_install

echo About to install files to current directory, which is
cd
echo If this is NOT the correct installation directory, hit CNTL-C, then 'Y'
pause

if "%1%"=="a" goto do_a
if "%1%"=="b" goto do_b

choice /C:ab "Which floppy drive are you installing from? "
if ERRORLEVEL 255 goto error
if ERRORLEVEL 2   goto do_b
if ERRORLEVEL 1   goto do_a
if ERRORLEVEL 0   goto cancel

:do_a
set SRC_DRIVE=A
goto do_it

:do_b
set SRC_DRIVE=B
goto do_it

REM Here we copy our install program to the dest drive and
REM re-execute the installation program.
:do_it
copy %SRC_DRIVE%:install.bat _xy.bat

REM run real install from hard drive
_xy %SRC_DRIVE%
:disk_1_install
echo Copying MPM...
copy %1%:\mpm1.img

:disk_2_check
echo Please insert diskette 2
pause
if EXIST %1%:DISK_2 goto disk_2_install
echo This is the wrong disk.
goto disk_2_check

:disk_2_install
copy %1%:\*.*
echo Building MPM image...
copy /b mpm1.img + mpm2.img mpm.img
echo Cleaning up... (ignore any further error messages.)
del DISK_?
del mpm1.img
del mpm2.img

:disk_3_check
echo Please insert diskette 3
pause
if EXIST %1%:DISK_3 goto disk_3_install
echo This is the wrong disk.
goto disk_3_check

:disk_3_install
copy %1%:\*.*
echo Cleaning up... (ignore any further error messages.)
del DISK_?
del _xy.bat
goto end

:cancel
echo Installation cancelled.
goto end
:error
echo Error detected during installation
goto end
:end

